/*
 * MR264Sink.cpp
 *
 *  Created on: 22 janv. 2010
 *      Author: mdulongpont
 */
#include "MR264Sink.h"
#include "OutputFile.hh"


MR264Sink::MR264Sink(UsageEnvironment& env, unsigned bufferSize) : MRSink(env,bufferSize){
}

MR264Sink::~MR264Sink(){
}

MR264Sink * MR264Sink::createNew(UsageEnvironment& env, unsigned bufferSize) {
  do {
    return new MR264Sink(env, bufferSize);
  } while (0);
  return NULL;
}

Boolean MR264Sink::sourceIsCompatibleWithUs(MediaSource& source) {
  // Just return true, should be checking for H.264 video streams though
    return True;
}

void MR264Sink::afterGettingFrame1(unsigned frameSize,struct timeval presentationTime) {
  unsigned char start_code[4] = {0x00, 0x00, 0x00, 0x01};
  addData(start_code, 4, presentationTime);
  MR264Sink::afterGettingFrame1(frameSize, presentationTime);
}
